<style>
.popup-center .fui-navbar .cartbtn {
    padding-right:0.3rem;background:#fff;opacity:1
}
.popup-center .fui-navbar .cartbtn {
    padding-right:0.3rem;background:#fff;opacity:1
}
.popup-center .fui-navbar .buybtn, .option-picker .fui-navbar .confirmbtn {
    padding-left:0.3rem;background:#fff
}
.fui-navbar .nav-item.btn {
    color: #fff;
    border-radius: 0.5rem;
}
.fee-tag-nav, .fee-tagup-nav, .fee-disabled-nav {border-radius:1rem;height:2rem;line-height:2rem;color:#fff;width:100%;font-weight:400;font-size:0.7rem;margin:0.2rem 0;padding:0 0.2rem}
.fee-tagup {background:{{main.syscolor || 'red'}};color:#fff;width:auto;font-weight:400;font-size:0.55rem}
.fee-tag-nav {background:{{main.syscolor || 'red'}}; opacity: 0.58;}
.fee-tagup-nav {background:{{main.syscolor || 'red'}};}
.fee-disabled-nav {background:#bbb;color:#fff;}	
</style>
<div ng-if="pagedata.showvideocall" class="popup">
	<div class="popup-body">
		<div class="popup-center">
			<div style="padding:0 0.5rem;padding-bottom:2.5rem">
				<div class="fui-cell-group">
					<div class="fui-cell-title c bold" style="margin-bottom:0.3rem"><span>{{pagedata.videocall.nickname}}发起了视频对话</span></div>
				</div>
				<div class="fui-navbar radius" style="-webkit-box-shadow:0 0 0 rgba(0,0,0,0.1);height: 2.7rem;background:none">
					<a href="javascript:;" ng-click="pagedata.showvideocall=false;access_json('jy_videocall/index//pluginname=jy_ailiao&tomid='+pagedata.videocall.tomid);" class="nav-item btn buybtn">
						<div class="fee-tagup-nav">
							前往处理
						</div>
					</a>
					
				</div>
			</div>
		</div>
	</div>
</div>
<!-- 待接听 -->
<audio id="phone_ringing" controls loop preload="auto" style="display:none;">
	<source src="../addons/jy_videocall/resource/call/phone_ringing.mp3"></source>
</audio>
<script type="text/javascript">
scope.pagedata.getvideocall=function(type){
	var voicetime = 0;
    var videocall;
	for(var i = 1;i<=100;i++){
		clearInterval(i);
	}
	if(type){
		 videocall = setInterval(() => {
			scope.get('jy_ailiao/get_data/getvideocall/',function(res){
				//console.log('getvideocall');console.log(res);
				if(res.videocall && res.videocall.id){
					scope.pagedata.videocall=res.videocall;
					console.log(voicetime);
					voicetime ++;
					$("#phone_ringing")[0].play();
					scope.pagedata.showvideocall=true;
					clearInterval(videocall);
					scope.$evalAsync();
				}
			});
		}, 3000);
	}
}
if(scope.page.action!='tcplog'){
	setTimeout(function(){
		scope.pagedata.getvideocall(1);
	},3000);
}
</script>